package org.itheima.mapper;


import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Mapper
public interface WarningsMapper {

    @Insert("insert into warnings(user_id,message,issued_by,time) values (#{user_id},#{message},#{issued_by},now())")
    void addWarnings(int user_id,String message,int issued_by);

    @Select("select * from warnings where user_id = #{user_id}")
    List<Map<String,Object>> findById(int user_id);

}
